home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
ISSUE03
/
CLINIC
/
LISTING3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-07-28
|
906b
|
26 lines
procedure TForm1.Button1Click(Sender: TObject);
var
LoopX, LoopY: Word;
begin
{ save typing this all the time }
with Image1.Picture do
{ Canvas property is only in bitmaps }
if Graphic is TBitmap then
with Graphic as TBitmap do
{ invert all pixels a column at a time }
for LoopX := 0 to Pred(Width) do
begin
for LoopY := 0 to Pred(Height) do
begin
Canvas.Pixels[LoopX, LoopY] := clWhite - Canvas.Pixels[LoopX, LoopY];
end;
{ standard technique to stop flickering on VGA }
while Port[$3DA] and 8 = 0 do;
{ be multi-user friendly - yield after each column }
Application.ProcessMessages;
{ also let user terminate app }
if Application.Terminated then
Break;
end;
end;